pandas drop all columns except certain ones

109

pandas drop all columns except certain ones -

df.drop(df.columns.difference(['a','b']), 1, inplace=True)

Comments

Submit
0 Comments